home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / BIOSTIME.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  418 b   |  17 lines

  1. /* biostime --- p 571 */
  2. #include <stdio.h>
  3. #include <bios.h>
  4. #define TIME_GETCLOCK 0
  5. main()
  6. {
  7.     long oldcount, newcount;
  8.     int ticks;
  9.     printf("How many seconds to wait? ");
  10.     scanf("%d", &ticks);
  11.     ticks *= 18.2;
  12.     oldcount = biostime(TIME_GETCLOCK, 0L);
  13.     newcount = oldcount;
  14.     while ((newcount-oldcount) < ticks)
  15.         newcount = biostime(TIME_GETCLOCK,0L);
  16.     printf("\nwaited for %d clock ticks\n", ticks);
  17. }